//
//  MCAfterSaleDetailBottomView.swift
//  StoreManage
//
//  Created by MC on 2018/2/2.
//  Copyright © 2018年 MC. All rights reserved.
//

import UIKit

class MCAfterSaleDetailBottomView: UIView {

    
    var isOnlyOne : Bool = false {
        didSet {
            if isOnlyOne {
                leftButton.snp.remakeConstraints { (make) ->Void in
                    make.left.bottom.top.equalTo(self)
                    make.width.equalTo(MCScreenWidth)
                }
            } else {
                leftButton.snp.remakeConstraints { (make) ->Void in
                    make.left.bottom.top.equalTo(self)
                    make.width.equalTo(MCScreenWidth / 2)
                }
                rightButton.snp.remakeConstraints { (make) ->Void in
                    make.right.bottom.top.equalTo(self)
                    make.width.equalTo(MCScreenWidth / 2)
                }
            }
        }
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.addSubview(leftButton)

        self.addSubview(rightButton)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    lazy var leftButton: UIButton = {
        let button = UIButton.init(type: UIButtonType.custom)
        button.titleLabel?.font = MCFont(14)
        button.backgroundColor = UIColor.MCAssist
        button.setTitle("拒绝", for: UIControlState.normal)
        button.setTitleColor(UIColor.white, for: UIControlState.normal)
        return button
    }()
    
    lazy var rightButton: UIButton = {
        let button = UIButton.init(type: UIButtonType.custom)
        button.titleLabel?.font = MCFont(14)
        button.backgroundColor = UIColor.MCMain
        button.setTitle("同意", for: UIControlState.normal)
        button.setTitleColor(UIColor.white, for: UIControlState.normal)
        return button
    }()

}
